/**
 * 数据字典service
 * @author 李艳
 */

import httpUtils from "../../../commons/utils/FeatchUtils";
import {basicUrl} from "../../../configs/DefaultConfig";
import {convertSearchFilter} from "../../../commons/utils/CommonUtils";

//获取为冻结租户
export async function findTenantAllUnfrozen(params = {}) {
  return httpUtils.get(basicUrl + "/tenant/findAllUnfrozen", params);
}

//字典目录
export async function findDataDictionary(params = {}) {
  Object.assign(params,{quickSearchProperties:["code","name"]});
  return httpUtils.postJson(basicUrl + "/dataDict/findByPage",convertSearchFilter(params));
}

//数据字典
export async function getDataDictItems(params = {}) {
  Object.assign(params,{isAll:true})
  return httpUtils.get(basicUrl + "/dataDict/getDataDictItems",params);
}
//保存数据字典类型
export async function saveDicCategory(params={}){
    return httpUtils.postJson(basicUrl+"/dataDict/save",params);
}
//保存数据字典
export async function saveDataDictItem(params={}){
    return httpUtils.postJson(basicUrl+"/dataDict/saveDictItem",params);
}
//删除数据字典类型
export async function deleteDicCategory(param=""){
    return httpUtils.delete(basicUrl+"/dataDict/delete",param);
}
//删除数据字典
export async function deleteDictItem(param=""){
    return httpUtils.delete(basicUrl+"/dataDict/delete",param);
}
